package com.gzu.azy.consumerRr;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@SpringBootApplication
public class ConsumerRrApplication {
    public static void main(String[] args) {
        SpringApplication.run(ConsumerRrApplication.class, args);
    }

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/call")
    public String call() {
        // “provide” 会被 LB 拆成 8080→8081→8082 循环
        return restTemplate.getForObject("http://provide/value", String.class);
    }
}
